package com.zisu.rabbitconsumer.component;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.DefaultConsumer;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * @Desc: ""
 * @Author: caixiang
 * @DATE: 2021/6/5 16:37
 */
public class MyDefaultConsumer extends DefaultConsumer {
    /**
     * Constructs a new instance and records its association to the passed-in channel.
     *
     * @param channel the channel to which this consumer is attached
     */
    public MyDefaultConsumer(Channel channel) {
        super(channel);
    }

    @Override
    public void handleCancel(String consumerTag) throws IOException {
        super.handleCancel(consumerTag);
        System.err.println("当master挂掉的时候，连接到 slave节点的客户端 收到 通知了。consumerTag:"+consumerTag);

    }
}
